import { http, HttpResponse } from 'msw'
import Mock from 'mockjs'
// 查
export const fileBinList = http.post('/data/ed/recycle/file/list', () => {
  let filelist = Mock.mock({
    'list|100': [
      {
        fileId: function () {
          return `file_${Mock.Random.increment()}`
        },
        fileName: '@name',
        fileType: '@string',
        fileVersion: '32314',
        updatedTime: '@date(yyyy-MM-dd HH:mm:ss)',
        fileNote: '@string',
        fileSize: 1033,
        fileSizeShow: '1030B',
        updatedBy: '@name',
        userName: '@name',
      },
    ],
  })
  return HttpResponse.json({
    success: true,
    errorCode: '',
    errorMessage: '',
    data: {
      records: filelist.list,
      total: 100,
    },
  })
})
// 彻底清除文件
export const deleteBinFile = http.get('/data/ed/recycle/file/remove', () => {
  return HttpResponse.json({
    success: true,
    errorCode: '',
    errorMessage: '',
  })
})
// 文件恢复
export const recoverBinFile = http.get('/data/ed/recycle/file/recover', () => {
  return HttpResponse.json({
    success: true,
    errorCode: '',
    errorMessage: '',
  })
})
